//华为首页JS
//nav里的JS
var a=document.querySelectorAll('.nav_left>ul>li>a');
for(var i=0;i<a.length;i++){
    a[i].onmouseover=function () {
        this.style.color='#CA141D';
        this.style.borderBottom='2px solid #CA141D'
    }
    a[i].onmouseout=function () {
        this.style.color='';
        this.style.borderBottom='';
    }
}

//banner里的js
var li=document.querySelectorAll('.banner>div>ul>li');
// console.log(li);
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function () {
        this.style.background='#3D3D3D';
        this.style.color='#fff';
        this.nextElementSibling.style.display='block';
    }
    li[i].onmouseout=function () {
        this.style.background='';
        this.style.color='';
        this.nextElementSibling.style.display='none';
    }
}

// section1里的JS
var a=document.querySelectorAll('.section1_top_left>div>p>span>a');
// console.log(a);
for(var i=0;i<a.length;i++){
    a[i].onmouseover=function(){
        this.style.color='#fff';
        this.parentElement.style.background='#f00';
    }
    a[i].onmouseout=function(){
        this.style.color='';
        this.parentElement.style.background='';
    }
}

var li=document.querySelectorAll('.section2_right>div>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section3里的JS
var li=document.querySelectorAll('.section3_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section4里的JS(轮播)
//自己动起来
//1.找到图片
    var lis=document.querySelectorAll('.tp>li');
//2.找到圆点
    var lia=document.querySelectorAll('.yd>li');
    function play(){
        setInterval(function(){
            lis[b].style.display='none';
            lia[b].style.background='#f00';
                b++;
                if(b>2){
                b=0;
                }
            lis[b].style.display='block';
            lia[b].style.background='#fff';
        },1000)
    }
    play();

// section5里的JS
//section5_top
var a=document.querySelectorAll('.section5_top>ul>li>a');
for(var i=0;i<a.length;i++){
    a[i].onmouseover=function () {
        this.style.color='#CA141D';
        this.style.borderBottom='2px solid #CA141D';
    }
    a[i].onmouseout=function () {
        this.style.color='';
        this.style.borderBottom='';
    }
}
//section5_buttom
var li=document.querySelectorAll('.section5_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section6里的JS
//section6_top
var a=document.querySelectorAll('.section6_top>ul>li>a');
for(var i=0;i<a.length;i++){
    a[i].onmouseover=function () {
        this.style.color='#CA141D';
        this.style.borderBottom='2px solid #CA141D';
    }
    a[i].onmouseout=function () {
        this.style.color='';
        this.style.borderBottom='';
    }
}
//section6_buttom
var li=document.querySelectorAll('.section6_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section7里的JS
//section7_top
var a=document.querySelectorAll('.section7_top>ul>li>a');
for(var i=0;i<a.length;i++){
    a[i].onmouseover=function () {
        this.style.color='#CA141D';
        this.style.borderBottom='2px solid #CA141D';
    }
    a[i].onmouseout=function () {
        this.style.color='';
        this.style.borderBottom='';
    }
}
//section7_buttom
var li=document.querySelectorAll('.section7_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section8里的JS
//section8_top
var a=document.querySelectorAll('.section8_top>ul>li>a');
for(var i=0;i<a.length;i++){
    a[i].onmouseover=function () {
        this.style.color='#CA141D';
        this.style.borderBottom='2px solid #CA141D';
    }
    a[i].onmouseout=function () {
        this.style.color='';
        this.style.borderBottom='';
    }
}
//section8_buttom
var li=document.querySelectorAll('.section8_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section9里的JS
//section9_buttom
var li=document.querySelectorAll('.section9_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section10里的JS
//section10_buttom
var li=document.querySelectorAll('.section10_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

// section11里的JS
//section11_buttom
var li=document.querySelectorAll('.section11_buttom>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.marginTop='-5px';
    }
    li[i].onmouseout=function(){
        this.style.marginTop='';
    }
}

//华为手机JS
var li=document.querySelectorAll('.main2>ul>li');
for(var i=0;i<li.length;i++){
    li[i].onmouseover=function(){
        this.style.borderColor='#f00';
    }
    li[i].onmouseout=function(){
        this.style.borderColor='';
    }
}

var a=document.querySelectorAll('.main2>ul>li>p:last-child>a');
// console.log(a);
for(var i=0;i<a.length;i++){
    a[i].onmouseover=function(){
        this.style.background='#f00';
        this.style.color='#fff';
    }
    a[i].onmouseout=function(){
        this.style.background='';
        this.style.color='';
    }
}









